﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.IO;

namespace WartburgInfo
{
    public partial class Cijfers : Form
    {
        bool firstBrowse;

        public Cijfers()
        {
            InitializeComponent();
            webBrowser1.DocumentCompleted += BrowserDocumentCompleted;
        }

        private void Cijfers_Load(object sender, EventArgs e)
        {
            new inlogInfo();
            webBrowser1.Navigate("https://login.wartburg.nl/nidp/idff/sso?Ecom_User_ID=" + inlogInfo.username + "&Ecom_Password=" + inlogInfo.password);
        }

        void BrowserDocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            if (e.Url.AbsolutePath != (sender as WebBrowser).Url.AbsolutePath && firstBrowse != true)
            {
                label1.Visible = false;
                webBrowser1.Visible = true;
                firstBrowse = true;
                webBrowser1.Navigate("https://leerlingen.wartburg.nl/GUIDO/Persoonlijk/Mijn_Cijfers");                
            }
        }

    }
}

